package com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.controller;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.service.Pxjhgllhx1Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.beans.factory.annotation.Autowired;
import com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.model.Pxjhgllhx1;
import com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.dto.Pxjhgllhx1Dto;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import org.springframework.web.bind.annotation.RequestBody;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.GetMapping;
import com.alibaba.fastjson.JSONObject;
import com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.vo.Pxjhgllhx1PageVO;
import com.jxdinfo.hussar.example.rypxjhgl.pxjhgllhx1.dto.Pxjhgllhx1Pxjhgllhx1dataset1;

/**
 * 培训计划管理lhx1控制器
 */
@RestController(value = "rypxjhgl.pxjhgllhx1.Pxjhgllhx1Controller")
@RequestMapping(value = "/rypxjhgl/pxjhgllhx1")
@AuditLog(moduleName = "培训计划管理lhx1")
@Api(tags = "培训计划管理lhx1控制器")
public class Pxjhgllhx1Controller {

    private static final Logger logger = LoggerFactory.getLogger(Pxjhgllhx1Controller.class);

    @Autowired
    private Pxjhgllhx1Service pxjhgllhx1Service;

    /**
     * 培训计划管理lhx1表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQueryPage(@RequestBody Page<Pxjhgllhx1> page) {
        return pxjhgllhx1Service.hussarQueryPage(page);
    }

    /**
     * 培训计划管理lhx1表格查询（带分页）
     *
     * @param page 分页对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQueryPage_order_custom")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQueryPage_order_custom(@RequestBody Page<Pxjhgllhx1> page) {
        return pxjhgllhx1Service.hussarQueryPage_order_custom(page);
    }

    /**
     * 培训计划管理lhx1表格查询（带分页）
     *
     * @param pxjhgllhx1dataset1 查询对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQuerypxjhgllhx1Condition_1Page")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQuerypxjhgllhx1Condition_1Page(@RequestBody Pxjhgllhx1Pxjhgllhx1dataset1 pxjhgllhx1dataset1) {
        return pxjhgllhx1Service.hussarQuerypxjhgllhx1Condition_1Page(pxjhgllhx1dataset1);
    }

    /**
     * 培训计划管理lhx1表格查询（带分页）
     *
     * @param pxjhgllhx1dataset1 查询对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQuerypxjhgllhx1Condition_1Page_order_custom")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQuerypxjhgllhx1Condition_1Page_order_custom(@RequestBody Pxjhgllhx1Pxjhgllhx1dataset1 pxjhgllhx1dataset1) {
        return pxjhgllhx1Service.hussarQuerypxjhgllhx1Condition_1Page_order_custom(pxjhgllhx1dataset1);
    }

    /**
     * 培训计划管理lhx1流程列表批量物理删除
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "流程列表批量物理删除", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.DELETE)
    @PostMapping(value = "/flowTableDeleteBatch")
    public ApiResponse<String> flowTableDeleteBatch(@RequestParam String ids) {
        return pxjhgllhx1Service.flowTableDeleteBatch(ids);
    }

    /**
     * 培训计划管理lhx1流程表格修改
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "流程表单修改权限判断", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping(value = "/flowTableUpdate")
    public ApiResponse<JSONObject> flowTableUpdate(@RequestBody Pxjhgllhx1Dto pxjhgllhx1Dto) {
        return pxjhgllhx1Service.flowTableUpdate(pxjhgllhx1Dto);
    }

    /**
     * 培训计划管理lhx1流程列表物理删除
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "流程列表物理删除", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.DELETE)
    @PostMapping("flowTableDelete")
    public ApiResponse<String> flowTableDelete(@RequestParam String id) {
        return pxjhgllhx1Service.flowTableDelete(id);
    }

    /**
     * 培训计划管理lhx1流程列表物理删除(仅删除未启动流程和节点处于第一节点的流程)
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "流程列表物理删除(仅删除未启动流程和节点处于第一节点的流程)", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.DELETE)
    @PostMapping("flowTableDeleteUnStart")
    public ApiResponse<String> flowTableDeleteUnStart(@RequestParam String id) {
        return pxjhgllhx1Service.flowTableDeleteUnStart(id);
    }

    /**
     * 培训计划管理lhx1表格查询
     *
     * @param pxjhgllhx1dataset1 查询对象
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQuerypxjhgllhx1Condition_1")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQuerypxjhgllhx1Condition_1(@RequestBody Pxjhgllhx1Pxjhgllhx1dataset1 pxjhgllhx1dataset1) {
        return pxjhgllhx1Service.hussarQuerypxjhgllhx1Condition_1(pxjhgllhx1dataset1);
    }

    /**
     * 培训计划管理lhx1表单查询
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表单查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @GetMapping("formQuery")
    public ApiResponse<Pxjhgllhx1> formQuery(@RequestParam(value = "id") String id) {
        return pxjhgllhx1Service.formQuery(id);
    }

    /**
     * 培训计划管理lhx1提交流程表单(优先提交至驳回节点)
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "提交流程表单(优先提交至驳回节点)", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.UPDATE)
    @PostMapping(value = "/flowFormSubmitReject")
    public ApiResponse<String> flowFormSubmitReject(@RequestBody Pxjhgllhx1Dto pxjhgllhx1Dto) {
        return pxjhgllhx1Service.flowFormSubmitReject(pxjhgllhx1Dto);
    }

    /**
     * 培训计划管理lhx1提交流程表单
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "提交流程表单", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.UPDATE)
    @PostMapping(value = "/flowFormSubmit")
    public ApiResponse<String> flowFormSubmit(@RequestBody Pxjhgllhx1Dto pxjhgllhx1Dto) {
        return pxjhgllhx1Service.flowFormSubmit(pxjhgllhx1Dto);
    }

    /**
     * 培训计划管理lhx1保存流程表单
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "保存流程表单", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("/flowFormSaveStart")
    public ApiResponse<String> flowFormSaveStart(@RequestBody Pxjhgllhx1Dto pxjhgllhx1Dto) {
        return pxjhgllhx1Service.flowFormSaveStart(pxjhgllhx1Dto);
    }

    /**
     * 培训计划管理lhx1新增或修改
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "新增或修改", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.INSERT)
    @PostMapping("insertOrUpdate")
    public ApiResponse<String> insertOrUpdate(@RequestBody Pxjhgllhx1 pxjhgllhx1) {
        return pxjhgllhx1Service.insertOrUpdate(pxjhgllhx1);
    }

    /**
     * 培训计划管理lhx1表格查询
     *
     * @return 查询结果
     */
    @AuditLog(moduleName = "培训计划管理lhx1", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("hussarQuery")
    public ApiResponse<Pxjhgllhx1PageVO> hussarQuery() {
        return pxjhgllhx1Service.hussarQuery();
    }
}
